home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 August: Tool Chest / Dev.CD Aug 00 TC Disk 2.toast / pc / sample code / human interface toolbox / htmlsample / renderingwindow.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-06-23  |  4.2 KB  |  118 lines

  1. /*
  2.     file RenderingWindow.h
  3.     
  4.     Description:
  5.     This file contains exported routine prototypes that can be used to call
  6.     the routines defined in RenderingWindow.c.  These routines used to
  7.     manage the windows displayed by the HTMLSample application.
  8.     
  9.     HTMLSample is an application illustrating how to use the new
  10.     HTMLRenderingLib services found in Mac OS 9. HTMLRenderingLib
  11.     is Apple's light-weight HTML rendering engine capable of
  12.     displaying HTML files.
  13.  
  14.     by John Montbriand, 1999.
  15.  
  16.     Copyright: © 1999 by Apple Computer, Inc.
  17.     all rights reserved.
  18.     
  19.     Disclaimer:
  20.     You may incorporate this sample code into your applications without
  21.     restriction, though the sample code has been provided "AS IS" and the
  22.     responsibility for its operation is 100% yours.  However, what you are
  23.     not permitted to do is to redistribute the source as "DSC Sample Code"
  24.     after having made changes. If you're going to re-distribute the source,
  25.     we require that you make it clear in the source that the code was
  26.     descended from Apple Sample Code, but that you've made changes.
  27.     
  28.     Change History (most recent first):
  29.     10/16/99 created by John Montbriand
  30. */
  31.  
  32. #ifndef __RENDERINGWINDOW__
  33. #define __RENDERINGWINDOW__
  34.  
  35. #include <Types.h>
  36. #include <Windows.h>
  37.  
  38.  
  39.  
  40. /* InitRenderingWindows is called to initialize the environment used by 
  41.     routines defined in this file.  It should be called before any of the 
  42.     other routines defined in this file are called. */
  43. OSStatus InitRenderingWindows(void);
  44.  
  45. /* CloseRenderingWindows closes any open rendering windows and
  46.     deallocates any structures allocated when InitRenderingWindows
  47.     was called. */
  48. OSStatus CloseRenderingWindows(void);
  49.  
  50.  
  51.  
  52. /* RWOpen opens a new, empty rendering window.  If successful,
  53.     then *rWindow will contain a pointer to a newly created window. */
  54. OSStatus RWOpen(WindowPtr *rWindow);
  55.  
  56. /* RWCloseWindow closes the rendering window pointed to by
  57.     rWin.  */
  58. void RWCloseWindow(WindowPtr rWin);
  59.  
  60. /* IsARenderingWindow returns true if rWin points to a rendering
  61.     window created by RWOpen. You should not call any of the routines
  62.     below for windows that are not rendering windows.  This routine
  63.     provides a convenient way to tell if a windowptr returned by one
  64.     of the toolbox routines is a rendering window. */
  65. Boolean IsARenderingWindow(WindowPtr rWin);
  66.  
  67.  
  68.  
  69. /* RWGotoURL displays HTML file referred to by the url in the
  70.     rendering window.  if addToHistory is true, then the window
  71.     will be added to the window's history list. */
  72. OSStatus RWGotoURL(WindowPtr rWin, char* url, Boolean addToHistory);
  73.  
  74. /* RWGotoAppRelLink displays HTML file referred to by the application
  75.     relative link in the rendering window.  if addToHistory is true, then
  76.     the window will be added to the window's history list. */
  77. OSStatus RWGotoAppRelLink(WindowPtr rWin, char* linkstr, Boolean addToHistory);
  78.  
  79.  
  80.  
  81. /* RWResetGotoMenu should be called before calling MenuKey or MenuSelect.  It
  82.     enables the back, forward, and home menu commands depending on what
  83.     commands are available and it rebuilds the history list at the bottom
  84.     of the go to menu. */
  85. void RWResetGotoMenu(WindowPtr rWin);
  86.  
  87. /* RWHandleGotoMenu should be called when an item is chosen from the
  88.     go to menu.  item is the number of the item that was chosen. */
  89. void RWHandleGotoMenu(WindowPtr rWin, short item);
  90.  
  91.  
  92.  
  93. /* RWUpdate should be called in response to an update event.
  94.     it calls BeginUpdate and EndUpdate redrawing the window's
  95.     contents as necessary. */
  96. void RWUpdate(WindowPtr rWin);
  97.  
  98. /* RWActivate should be called in response to activate events.*/
  99. void RWActivate(WindowPtr rWin, Boolean activate);
  100.  
  101. /* RWRecalculateSize should be called whenever the size of a rendering
  102.     window changes.  This routine resizes and redraws the windows
  103.     contents appropriately. */
  104. void RWRecalculateSize(WindowPtr rWin);
  105.  
  106. /* RWHandleMouseDown should be called in response to mouse down
  107.     events occuring inside of a rendering window.  This routine responds
  108.     to mouse clicks in the controls at the top of the window. */
  109. void RWHandleMouseDown(WindowPtr rWin, Point where);
  110.  
  111. /* RWKeyDown should be called for keydown events when a rendering
  112.     window is the frontmost window.  This routine maps the left, up,
  113.     and right arrow keys to the back, home, and forward commands. */
  114. void RWKeyDown(WindowPtr rWin, char theKey);
  115.  
  116. #endif
  117.  
  118.